package com.ccb.ic.bbs.controller;

import com.ccb.ic.query.bbs.ResultDTO;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class VideoController {

    @GetMapping("/bbs/videos")
    public Object index(Model model) {
        model.addAttribute("navtype", "videonav");
        return ResultDTO.okOf(model);
    }

    @GetMapping("/bbs/video")
    public Object video(@RequestParam(name = "aid") String aid,
                        @RequestParam(name = "page", defaultValue = "1") String page
    ) {
        Map<String, Object> model = new HashMap<>();
        model.put("aid", aid);
        model.put("page", page);
        model.put("navtype", "videonav");
        return ResultDTO.okOf(model);
    }
}

